# Maintainer: Frederik Schwan <freswa at archlinux dot org>
# Contributor: Mattias Andrée <`base64 -d`(bWFhbmRyZWUK)@kth.se>

pkgname=sha3sum
pkgver=1.2.3
pkgrel=1
pkgdesc="Keccak-family checksum calculator, including SHA-3"
arch=('loong64' 'x86_64')
url='https://codeberg.org/maandree/sha3sum'
license=('custom:ISC')
depends=('libkeccak>=1.2')
source=("https://codeberg.org/maandree/sha3sum/archive/${pkgver}.tar.gz")
b2sums=('f864267f68f257a52afc9aeeb96d6aab96a8a70c3139ff08881b261d6ee2477d116dd5d1cae359850e973ae37a44230b7202c18c5e93c97e4c34190aa7a57909')

prepare() {
  cd ${pkgname}
  # inject our flags into the build
  sed -i -r 's#^(.*)FLAGS\s+=(.*)$#\1FLAGS :=\2 \$(\1FLAGS)#g' config.mk
}

build() {
  cd ${pkgname}
  make PREFIX=/usr
}

check() {
  cd ${pkgname}
  make check
}

package() {
  cd ${pkgname}
  make PREFIX=/usr DESTDIR="${pkgdir}" install
}
